﻿using log4net;
using RSSDataPump.Types;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RSSDataPump
{
    /**  Written by Charles Morrison
     *   Reads an RSS feed and pumps data to a SQL database
     * **/
    class Program
    {
        private static readonly ILog logger = LogManager.GetLogger(typeof(Program));
        static void Main(string[] args)
        {
            RSSRead rss = new RSSRead();
            try
            {
                var authList = SqlDB.GetNewsAuthors();

                foreach (Authors a in authList)
                {
                    //check rssfeed
                    rss.RssFeed(a.Url);
                }
            }
            catch(Exception e)
            {
                logger.Error(e.ToString());
            }
        }
    }
}
